package ${rootPkg}.service.${modelName}.${entityVar};

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.bitkit.basic.annotation.ServiceTag;
import cn.bitkit.basic.container.PageRequest;
import cn.bitkit.basic.container.PageResponse;
import cn.bitkit.component.BaseService;
import cn.bitkit.mybatis.QueryCriteria;
import cn.bitkit.mybatis.handler.PageDataHandler;

import ${rootPkg}.pojo.dto.${modelName}.${entityVar}.${entityName}PageReq;
import ${rootPkg}.pojo.dto.${modelName}.${entityVar}.${entityName}PageResp;
import ${rootPkg}.pojo.entity.${modelName}.${entityName};
import ${rootPkg}.mapper.${modelName}.${entityName}Mapper;

@Service
@ServiceLabel("${entityVar}Page")
public class ${entityName}PageService implements BaseService<PageRequest<${entityName}PageReq>, PageResponse<${entityName}PageResp>> {

    @Autowired
    ${entityName}Mapper ${entityVar}Mapper;

    @Override
    public PageResponse<${entityName}PageResp> execute(PageRequest<${entityName}PageReq> req) {
        QueryCriteria criteria = QueryCriteria.createPage(req);
        List<${entityName}> list = ${entityVar}Mapper.selectPage(criteria);
        return PageDataHandler.getPageResponse(list, criteria, ${entityName}PageResp.class);
    }

}